<template>
  <div class="container" @click="clickMine">
    <div class="left">
      <img :src="userAvatar || defaultAvator">
      <span @click="functionDot('我的')">我的</span>
    </div>
    <div class="right">
      <span @click="functionDot('红包、奖品和观看记录等')">{{ mineText }}</span>
      <img src="@/assets/images/zxjt/path.png">
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      mineText:'',
      num:0,
      number:0,
      defaultAvator:require('@/assets/images/zxjt/personal.png')
    }
  },
  created() {
    this.mineText =  this.$channel == 'zxjtqh'?'奖品、观看记录等':'红包、奖品和观看记录等'
  },
  computed:{
      userAvatar(){
        return this.$store.state.userInfo.wxpic;
      }
  },
  methods: {
    clickMine() {
      if (this.$store.state.isYk) { //游客
        fun.ykDisposeFun();
      } else {
        this.$router.push({
          path: `/${this.$channel}/mine`,
        });
      }
    },
    //中信建投功能埋点
    functionDot(functionName) {
      if (this.$channel !== 'zxjt') return
      $sensorsTrack('liveBroadcast_liveRoomDetailsPageFunctionClick',
        {
          page_name: '首页',
          function_name:functionName
        }
      );
    }
  }
}
</script>

<style scoped="scoped" lang="less">
.container {
  width: 100%;
  height: 60px;
  margin-top: 30px;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
    .left{
      display: flex;
      justify-content: space-between;
      align-items: center;
      img{
        width: 60px;
        height: 60px;
        vertical-align: middle;
        border-radius: 50%;
      }
      span{
        font-size: 30px;
        font-weight: 500;
        color: #666666;
        line-height: 42px;
        margin-left: 20px;
      }
    }

  .right {
    justify-content: space-between;

    span {
      font-size: 24px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #999999;
      line-height: 33px;
      letter-spacing: 1px;
    }

    img {
      width: 20px;
      height: 20px;
      vertical-align: middle;
    }
  }
}
</style>
